//
//  IndexViewController.m
//  CargocnRun
//
//  Created by mac on 2018/3/19.
//  Copyright © 2018年 mac. All rights reserved.
//

#import "IndexViewController.h"
#import "test1ViewController.h"
#import "YUTestViewController.h"
//#import "FoldingViewController.h"
#import "YUCustomTestController.h"
@interface IndexViewController ()<UITableViewDelegate,UITableViewDataSource,UIScrollViewDelegate>
@property (nonatomic,strong) UITableView *tableView;
@property (nonatomic,strong) NSArray *dataArray;
@property (nonatomic,assign) NSInteger num;

@end

@implementation IndexViewController
-(void)viewWillAppear:(BOOL)animated
{
    [self addNaviBarColor];
    //    self.navigationItem.title=@"标题";
    //    [self.navigationController.navigationBar setPrefersLargeTitles:YES];
    self.navigationItem.largeTitleDisplayMode =  UINavigationItemLargeTitleDisplayModeNever;//这个是标题显示的方式，下面会详细的说
    //        [self addBackNaviLeftItem];
    //        [self addHomePageNaviRightItemByImg:@"tab0"];
    //    self.navigationController.navigationBar.prefersLargeTitles = YES;//这句话表示是否显示大标题

    //    self.title = @"设置";//设置标题
    //    self.navigationItem.largeTitleDisplayMode =  UINavigationItemLargeTitleDisplayModeAlways;//这个是标题显示的方式，下面会详细的说
    //    [self.navigationController.navigationBar setLargeTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor], NSForegroundColorAttributeName,[UIFont systemFontOfSize:18.0f],NSFontAttributeName,nil]];
    //    [self.navigationItem addRightItemTarget:self action:@selector(togogooo) andImageName:@"tab0" andSize:CGSizeMake(40, 40)];
}
-(void)togogooo
{
    self.dataArray = @[@"1",@"22",@"333",@"444",@"555",@"666",@"666",@"777",@"888",@"999",@"000",@"999",@"999",@"000",@"999",@"999",@"000",@"999",@"999",@"000",@"999",@"999",@"000",@"999",@"999",@"000",@"999",@"999",@"000",@"999",@"999",@"000",@"999",@"999",@"000",@"999",@"999",@"000",@"999",@"999",@"000",@"999",@"999",@"000",@"999",@"999",@"000",@"999",@"999",@"000",@"999",@"999",@"000",@"999",@"999",@"000",@"999"];
    [self.tableView reloadData];
}

- (void)viewDidLoad {
    [self aaaaaa];
    //    self.navigationItem.title=@"标题";
    //    [self.navigationController.navigationBar setPrefersLargeTitles:YES];
    //    self.navigationItem.largeTitleDisplayMode =  UINavigationItemLargeTitleDisplayModeAlways;//这个是标题显示的方式，下面会详细的说
    self.dataArray = @[@"11",@"212",@"3331",@"4441",@"5551",@"6661",@"6661",@"7771",@"8881",@"9991",@"0001",@"9991",@"22",@"333",@"444",@"555",@"666",@"22",@"333",@"444",@"555",@"666",@"22",@"333",@"444",@"555",@"666",@"22",@"333",@"444",@"555",@"666",@"22",@"333",@"444",@"555",@"666",@"22",@"333",@"444",@"555",@"666",@"22",@"333",@"444",@"555",@"666"];
    //    self.title = @"我是标题";
    [super viewDidLoad];
    //    self.view.backgroundColor = [UIColor redColor];
    self.num = 30;
    ILog(@"%f---%f",40*ScaleRate*self.num,40*ScaleRate);
    self.tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    //    [self.view addSubview:self.tableView];


    UIButton *BTN = [[UIButton alloc] initWithFrame:CGRectMake(0, ScreenHeight-XIndicator-89, ScreenWidth, 40)];
    [BTN setTitle:@"我是按钮" forState:UIControlStateNormal];
    [BTN setBackgroundColor:KBLUECOLOR];
    //    BTN.alpha = 0.2;
    [BTN addTarget:self action:@selector(topush) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:BTN];
}
-(void)topush
{
    //    YUCustomTestController *testVc = [[YUCustomTestController alloc] init];
    //    testVc.title = @"111";
        //    testVc.title = @"111";
    //    testVc.arrowPosition = 3;
    //    [self.navigationController pushViewController:testVc animated:YES];
//    YUCustomTestController *testVc = [[YUCustomTestController alloc] init];
//    testVc.title = @"111";
//    testVc.arrowPosition = 3;
//    [self.navigationController pushViewController:testVc animated:YES];
    YUTestViewController *wallet = [[YUTestViewController alloc] init];
//    YUCustomTestController *wallet = [[YUCustomTestController alloc] init];
    self.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:wallet animated:YES];
    self.hidesBottomBarWhenPushed = NO;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSString *identifier = @"Indentifier";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
    if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];
    }
    cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
    cell.textLabel.text = [self.dataArray objectAtIndex:indexPath.row];
    return cell;

}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.dataArray.count;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 40*ScaleRate;
}
-(void)aaaaaa
{
    //    NSString*aa = @['181203155731652348','181203160133158437','181203160435215569','181203160635987048','181203160806507318','181203161547445038','181203160926946115','181203161655523695','181203162248777092','181203163007308314','181203160421024350','181203163300878550','181203163948543976','181203161220990211','181203161730800301','181203163618069382','181203155342706446','181203162314905075','181203155959737866','181203162534378113','181203161007163792','181203160417563581','181203162642890648','181203160535443652','181203155818055768','181203162209533943','181203160247758531','181203162309609691','181203160509401090','181203155423801438','181203162525672294','181203161511657389','181203161953044414'];
    NSString *str = @"";
    NSArray * tagsArray = [str componentsSeparatedByString:@" "];//以“,”切割
    ILog(@"%ld",[tagsArray count]);
    NSString *strUrl = [str stringByReplacingOccurrencesOfString:@" " withString:@"','"];
    MITLog(@"%@",[NSString stringWithFormat:@"'%@'",strUrl]);
}
/*
 #pragma mark - Navigation

 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
